<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <title>View All Branches</title>
    </h:head>
    <h:body>
        <h:form id="formViewBranch">
            <p:panel id="viewBranch" header="View All Branches">
                <p:dataTable var="branch" value="#{branchManagerBean.branchList}" emptyMessage="No branches found">  
                    <f:facet name="header">  
                        <p:outputPanel>  
                            <h:outputText value="Search all fields: " />  
                            <p:inputText id="globalFilter" onkeyup="branchManagerBean.filterOptions()" style="width:150px" />  
                        </p:outputPanel>  
                    </f:facet>  

                    <p:column filterBy="#{branch.branchName}" headerText="Branch Name" filterMatchMode="contains">  
                        <h:outputText value="#{branch.branchName}" />  
                    </p:column>  
                    
                    <p:column filterBy="#{branch.contactPerson}" headerText="Contact Person" filterMatchMode="contains">  
                        <h:outputText value="#{branch.contactPerson}" />  
                    </p:column>

                    <p:column filterBy="#{branch.contactNumber}" headerText="Contact Number" filterMatchMode="contains">  
                        <h:outputText value="#{branch.contactNumber}" />  
                    </p:column>  
                    
                    <p:column style="width:200px">
                        <p:commandButton value="Manage Branch Details" actionListener="#{branchManagerBean.view_Edit_Branch(branch)}" >
                            
                        </p:commandButton>
                    </p:column>
                </p:dataTable>
            </p:panel>
        </h:form>
    </h:body>
</html>

